#include "renderer.h"
#include "manager.h"
#include "ui_renderer.h"

Renderer::Renderer(QWidget *parent, MainWindow *_wnd) : QWidget(parent), ui(new Ui::Renderer)
{
    ui->setupUi(this);
    m_Rendering = false;
    m_MainWnd = _wnd;
    QObject::connect((Manager*) m_MainWnd->m_Manager, SIGNAL(RenderNext(const QPixmap&)), this, SLOT(Render(const QPixmap&)));
}

Renderer::~Renderer()
{
    delete ui;
}

void Renderer::Render(const QPixmap& pixmap)
{
    ui->label->setPixmap(QPixmap(512, 512));
    QPixmap pixmapScaled = pixmap.scaled(512, 512);
    ui->label->setPixmap(pixmapScaled);
    ui->label->update();
}

